package com.shawn.integeration.batch.file.processor;

import com.shawn.integeration.business.student.model.Student;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.stereotype.Component;

/**
 * @author shawn
 * @description: 学生处理器
 * @date 2024/1/13
 */
@Component
public class StudentProcessor implements ItemProcessor<Student, Student> {

    @Override
    public Student process(Student student) throws Exception {
        // 将性别为1的都该为0
        if (student.getSex() == 1) {
            student.setSex(0);
        }
        return student;
    }
}
